<?php

namespace app\admin\model\lnventory;

use think\Model;

class Details extends Model
{
    // 表名
    protected $name = 'lnventory_details';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = false;
    
    // 追加属性
    protected $append = [

    ];

    public function datas()
    {
        return $this->belongsTo('Data', 'id', 'lnventory_id', [], 'LEFT')->setEagerlyType(0);
    }

    public function details()
    {
        return $this->hasMany('Data','id','lnventory_id');
    }
}
